<?php
/**
 * Created by PhpStorm.
 * User: qttx
 * Date: 2019/6/1
 * Time: 17:27
 */
namespace app\api\controller;


use app\api\model\RealModel;

class Realname extends BaseController
{
    public function __construct()
    {
        parent::__construct();
        $this->real = new RealModel();
    }

    /**实名认证申请--添加**/
    public function realname_update()
    {
        $id = $this->uid;
		//$add['uid'] = request()->post('uid');
		$add['name'] = request()->post('name');
      	if(empty($add['name']))
        {
            AjaxReturn('1','请输入真实姓名');
        }
        $add['cost'] = request()->post('cost');
        $add['phone'] = request()->post('phone');
      	if(empty($add['phone']))
        {
            AjaxReturn('1','请输入手机号');
        }
        $add['card'] = request()->post('card');
      	if(empty($add['card']))
        {
            AjaxReturn('1','请输入身份证号');
        }
        $add['realtime'] = time();
        $realname_update = $this->real->realname_update($add,$id);

        if($realname_update)
        {
            AjaxReturn('1','成功');
        }else{
            AjaxReturn('0','失败');
        }
    }
}